﻿@model tantrinh.Models.SanPham

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
@if (Request.IsAuthenticated && @Session["UserId"] != null)
{
<h1>Quản lý sản phẩm</h1>
<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>SanPham</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.MaSanPham)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MaSanPham)
            @Html.ValidationMessageFor(model => model.MaSanPham)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TenSanPham)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TenSanPham)
            @Html.ValidationMessageFor(model => model.TenSanPham)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.GiaSanPham)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.GiaSanPham)
            @Html.ValidationMessageFor(model => model.GiaSanPham)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.AnhDaiDien)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.AnhDaiDien)
            @Html.ValidationMessageFor(model => model.AnhDaiDien)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.MoTa)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MoTa)
            @Html.ValidationMessageFor(model => model.MoTa)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LuotView)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LuotView)
            @Html.ValidationMessageFor(model => model.LuotView)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ChiTietDanhMucID, "ChiTietDanhMuc")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ChiTietDanhMucID", String.Empty)
            @Html.ValidationMessageFor(model => model.ChiTietDanhMucID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.NhanHieuID, "NhanHieu")
        </div>
        <div class="editor-field">
            @Html.DropDownList("NhanHieuID", String.Empty)
            @Html.ValidationMessageFor(model => model.NhanHieuID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.NgayDang)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.NgayDang)
            @Html.ValidationMessageFor(model => model.NgayDang)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TinhTrang)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TinhTrang)
            @Html.ValidationMessageFor(model => model.TinhTrang)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
}
else
{
    <p>
        Xin vui lòng đăng nhập</p>
    <script type="text/javascript">
        window.location.href = "http://tantrinhcaraudio.com/admin"
    </script>
}